/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tuitionmanagement.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;



/**
 *
 * @author Admin
 */
public class PassEncrypt {

    /**
     * 
     * @param pass
     * @return Encryption Password
     */
     public PassEncrypt() {
    }

    public String HMD5(String pass) {
        String temp = "";
        byte[] hash;
        MessageDigest md;
        try {
            md = MessageDigest.getInstance("MD5");
            hash = md.digest(pass.getBytes());
            for (int i = 0; i < hash.length; i++) {
                temp += Byte.toString(hash[i]);
            }
        } catch (NoSuchAlgorithmException ex) {
            ex.printStackTrace();
        }
        return temp;
    }
}
